package com.usian.tu.controller;

import com.apis.img.AdimgApi;
import com.usian.model.admin.dtos.NewsAuthDto;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.media.dtos.WmMaterialDto;
import com.usian.model.media.dtos.WmNewsPageReqDto;
import com.usian.model.media.dtos.WmNewsPassDto;
import com.usian.tu.service.WmMaterialservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@RestController
@RequestMapping("wemediatu/api/vi/")
public class ImgController implements AdimgApi {

    @Autowired
    private WmMaterialservice wmMaterialservice;




//媒体回显
    @RequestMapping("/meitihuixian/{id}")
    @Override
     public ResponseResult meitihuixian(@PathVariable Integer id){
        return wmMaterialservice.meitihuixian(id);
    }



    @RequestMapping("/pass")
    @Override
    public ResponseResult pass(@RequestBody WmNewsPassDto wmNewsPassDto){
        return wmMaterialservice.pass(wmNewsPassDto);
    }

    @RequestMapping("/fail")
    @Override
    public ResponseResult fail(@RequestBody WmNewsPassDto wmNewsPassDto){
        return wmMaterialservice.fail(wmNewsPassDto);
    }

//媒体全查
    @PostMapping("/wzlist")
    @Override
    public ResponseResult wzlist(@RequestBody WmNewsPageReqDto dto) {
        return wmMaterialservice.wzlist(dto);
    }
//媒体全查 2
    @PostMapping("/wzlisttu")
    @Override
    public ResponseResult wzlisttu(@RequestBody NewsAuthDto dto) {
        return wmMaterialservice.wzlisttu(dto);
    }
//图片上传
    @PostMapping("/tusc")
    @Override
    public ResponseResult sc(MultipartFile multipartFile) {
        return wmMaterialservice.sc(multipartFile);
    }

//    图片上传全查
    @PostMapping("/sucailist")
    @Override
    public ResponseResult sucailist(@RequestBody WmMaterialDto dto) {
        return wmMaterialservice.sucailist(dto);
    }

//    媒体删除
    @GetMapping("del/{id}")
    @Override
    public ResponseResult del(@PathVariable Integer id) {
        return wmMaterialservice.del(id);
    }

//媒体状态
    @GetMapping("zt/{id}/{uid}")
    @Override
    public ResponseResult zt(@PathVariable Integer id, @PathVariable Integer uid) {
        return wmMaterialservice.zt(id, uid);
    }


}
